home *** CD-ROM | disk | FTP | other *** search
/ Learn Microsoft Visual Basic 6.0 Now / Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO / media / chap01 / b01d030.cc2 < prev    next >
Text File  |  1998-06-07  |  2KB  |  44 lines

  1. 0, Okay, we're ready to run our Lucky Seven 
  2. 3, program in the Visual Basic programming 
  3. 5, environment. Before we actually run the 
  4. 7, application, we may want to go down to 
  5. 9, the Form Layout Window and drag the tiny 
  6. 11, icon inside the monitor to the middle 
  7. 12, of the screen. That will display our 
  8. 14, window in the center of the screen when the 
  9. 16, program runs. When you're ready to run 
  10. 18, your program, you want to click the Start 
  11. 21, button on the Visual Basic toolbar. 
  12. 24, When you click the Start button, the 
  13. 25, program runs in the Visual Basic programming 
  14. 27, environment. To start our program, we'll 
  15. 29, click the Spin button and bingo! A seven 
  16. 32, appears in the first spinner window, 
  17. 33, and we have a stack of coins announcing a 
  18. 35, winner. The next time we click, the 
  19. 37, seven appears in the third window and we 
  20. 39, win. The next time, it's in the second 
  21. 41, window, and we win. And then, it's in the 
  22. 44, first window again, and then, in the 
  23. 46, second window. You can see that we won a 
  24. 49, bunch of times at first, although the actual 
  25. 51, win rate is only 29%. And if we keep 
  26. 54, going, we'll win sometimes and we'll lose 
  27. 57, sometimes. When we're ready to stop 
  28. 59, playing, we'll click the End button to stop 
  29. 62, the program. Now, if we'd like to change 
  30. 65, the numbers that appear each time in the 
  31. 66, Lucky Seven program, in other words, if 
  32. 68, we'd like to have a new set of random 
  33. 70, numbers every time, we can open the 
  34. 73, Form_Load event procedure in the Code window, 
  35. 76, type the Randomize function, and run 
  36. 82, the program again. This time, it's a 
  37. 85, completely random set of spins. And we're not 
  38. 88, sure exactly what we're going to get. 
  39. 91, If we run it again, we'll have another 
  40. 95, set of random numbers. The actual win rate 
  41. 98, of this program is about 29%. And when 
  42. 101, we're finished, we'll click the End 
  43. 102, button to close.
  44. 105, END